function logMessage(msg: string, level?: 'warn' | 'error') {
  console.log(msg, level)
}
logMessage('hello world')
logMessage('hello world', 'warn')

function sum(...nums: number[]) {
  return nums.reduce((acc, num) => acc + num, 0)
}

console.log(sum(1, 2, 3, 4, 5))

const arr = [1, 2, 3]
arr.push(4)
// arr.push('4')

type User = {
  name: string;
  age: number;
}
function formatUser({name, age}: User): string {
  return `${name} is ${age} years old.`
}

export {}